import numpy as np
import matplotlib.pyplot as plt
np.seterr(divide='ignore',invalid='ignore')

def f(x):
    return x**8 - 8*x**7 + 28*x**6 - 56*x**5 + 70*x**4 - 56*x**3 + 28*x**2 - 8*x + 1

def g(x):
    return (((((((x - 8)*x + 28)*x - 56)*x + 70)*x -56)*x + 28)*x - 8)*x + 1

def h(x):
    return (x - 1)**8

x = np.linspace(0.99, 1.01, 101)

plt.plot(x, f(x), label='f(x)')
plt.plot(x, g(x), label='g(x)')
plt.plot(x, h(x), label='h(x)')

plt.legend()
plt.savefig("A.png")
